package fr.flogo.destinee.cameras;

import javax.microedition.khronos.opengles.GL10;

public class VerySimple2DCamera implements ICamera {

	float position[] = new float[] { 0, 0, 0 };

	public VerySimple2DCamera() {
	}

	@Override
	public void translate(GL10 gl, float x, float y, float z) {
		this.position[0] = x;
		this.position[1] = y;
		this.position[2] = z;
	}

	@Override
	public void rotation(GL10 gl, float angle, float x, float y, float z) {
		// not implemented on this version of this camera
	}

	@Override
	public float[] getPosition() {
		return this.position;
	}

	@Override
	public void turn(float angle, float x, float y, float z) {
		// not implemented on this version of this camera
	}

	@Override
	public void move(float x, float y, float z) {
		this.position[0] += x;
		this.position[1] += y;
		this.position[2] += z;
	}

	@Override
	public void drawMovement(GL10 gl) {
		
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

		gl.glMatrixMode(GL10.GL_MODELVIEW);
		// Reset the Modelview Matrix
		gl.glLoadIdentity();

//		gl.glRotatef(90.0f, 1.0f, 0, 0);
		this.translate(gl, this.position[0], this.position[1], this.position[2]);
		
		gl.glScalef(0.6f, 0.6f, 0.6f);
	}

}
